﻿using LogManager.Core.Models;
using System.Net;

namespace LogManager.Core.Helpers
{
    public static class ModelsExtensions
    {
        public static NetworkCredential GetSourceCredentials(this ILocation location)
        {
            var plateform = location.ParentServer.ParentPlateform;
            return new NetworkCredential(plateform.Login, plateform.Password, plateform.Domain);
        }

        public static NetworkCredential GetDestinationCredentials(this ILocation location)
        {
            var warehouse = location.ParentServer.ParentPlateform.ParentWarehouse;
            return new NetworkCredential(warehouse.Login, warehouse.Password, warehouse.Domain);
        }
    }
}
